/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.workforce.common.tags;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;

/**
 *
 * @author neo
 */
public class FieldOptionTag extends FieldBaseTag {
    protected String value;
    @Override
    public int doStartTag() throws JspException {
        JspWriter out = pageContext.getOut();
        StringBuffer s = new StringBuffer();
        s.append("<option ");
         if( value != null ) {
            s.append("value=\"").append(value).append("\" ");
        }
        s.append(">");
        if( label != null ) {
            s.append(label);
        }
        s.append("</option>");
        try {
            out.print(s.toString());
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return SKIP_BODY;
    }

    @Override
    public int doEndTag() throws JspException {
        return super.doEndTag();
    }

    public void setValue(String value) {
        this.value = value;
    }


}
